home *** CD-ROM | disk | FTP | other *** search
/ Quick PC 62 / Quick PC 62.iso / Programs / Virtual.CD.v5.0.2.Network.Edition.WinALL / VCD502EG.exe / Program Files / Virtual CD v5 / Language / GER / Template / Insert.vtm < prev    next >
Encoding:
Text File  |  2003-02-28  |  1.4 KB  |  50 lines

  1. ' **************************************************
  2. ' * Script generated by Virtual CD v5
  3. ' * Copyright 2003 by H+H Software GmbH
  4. ' **************************************************
  5. Option Explicit
  6.  
  7. Const VCD_ERROR_NONE = 0
  8. Const DLGTITLE = "Virtual CD Skript"
  9. Const DLGERRORMSG = "Fehler beim Einlegen einer virtuellen CD "
  10. Const DLGEC = " EC: "
  11.  
  12. DIM IApi            ' Virtual CD v4 SDK API Object
  13. ' Init the VCD SDK object
  14. Set IApi = CreateObject("Vc5api.Api")
  15.  
  16. ' Insert the virtual CDs
  17. #VCDINSERTBLOCK
  18.  
  19. Set IApi = Nothing
  20. WScript.Quit(0)
  21.  
  22. ' **************************************************
  23. ' Insert a virtual CD
  24. ' strVCDDrive - Drive letter (empty for default)
  25. ' strVCDName - Name of the virtual CD
  26. ' **************************************************
  27. Function InsertVCD(strVCDDrive, strVCDName)
  28.     DIM strDrive        ' current drive of a VCD
  29.     DIM strVCDDrives    ' Available virtual dirves
  30.  
  31.     ' If there is no file name stop
  32.     If Len(strVCDName) <> 0 Then
  33.         ' get the virtual drive where the CD is inserted
  34.         strDrive = IApi.VCDGetMountDrive(strVCDName)
  35.         
  36.         ' eject the CD if it was inserted
  37.         If Len(strDrive) <> 0 then
  38.             IApi.VCDEject(strDrive)
  39.         End If
  40.     
  41.         ' insert the virtual CD
  42.         InsertVCD = IApi.VCDInsert(strVCDDrive, strVCDName, "")
  43.         
  44.         ' if something was wrong come up with an error
  45.         If InsertVCD <> VCD_ERROR_NONE then
  46.             MsgBox DLGERRORMSG & strVCDName & DLGEC & InsertVCD, vbExclamation, DLGTITLE
  47.         End If
  48.     End If
  49. End Function
  50.